package com.itcast.demo;

import com.itcast.SessionUtils.SessionUtils;
import com.itcast.domain.User;
import com.itcast.mapper.UserMapper;
import org.junit.Test;

import java.util.List;

public class Demo01 {
    @Test
    public void findAll(){
        UserMapper mapper = SessionUtils.getSession().getMapper(UserMapper.class);
        List<User> all = mapper.findAll();
        System.out.println("findAll = " + all);
        SessionUtils.getSession().commit();
        SessionUtils.getSession().close();
    }
    @Test
    public void findByID(){
        UserMapper mapper = SessionUtils.getSession().getMapper(UserMapper.class);
        List<User> byID = mapper.findByID(22);
        System.out.println("byID = " + byID);
    }
}
